win32: Don't check the position of a NULL device
authorCarlos Garnacho <carlosg@gnome.org>
Tue, 27 Jan 2015 11:24:18 +0000 (11:24 +0000)
committerCarlos Garnacho <carlosg@gnome.org>
Wed, 28 Jan 2015 16:59:29 +0000 (16:59 +0000)
This function is given a barely setup GdkEvent, so the GdkDevice field
is still unset, causing warnings and misbehaviors when the position
is queried for it.

Given that the wintab GTK+ code seems to rely somewhat hard on the wintab
device managing the pointer cursor, query the pointer position from the
pointer itself.

https://bugzilla.gnome.org/show_bug.cgi?id=743330

gdk/win32/gdkdevicemanager-win32.c

index a645c105e314f493e50d024307260fa3bcb07d81..7eba80b0de658bf5394124541246934ffaeb5f6c 100644 (file)
@@ -886,7 +886,6 @@ _gdk_input_other_event (GdkEvent  *event,
   GdkDeviceManagerWin32 *device_manager;
   GdkDeviceWintab *source_device = NULL;
   GdkDeviceGrabInfo *last_grab;
-  GdkDevice *device = NULL;
   GdkEventMask masktest;
   guint key_state;
   POINT pt;
@@ -908,9 +907,7 @@ _gdk_input_other_event (GdkEvent  *event,
     }
 
   device_manager = GDK_DEVICE_MANAGER_WIN32 (gdk_display_get_device_manager (_gdk_display));
-
-  device = gdk_event_get_device (event);
-  window = gdk_device_get_window_at_position (device, &x, &y);
+  window = gdk_device_get_window_at_position (device_manager->core_pointer, &x, &y);
   if (window == NULL)
     window = _gdk_root;